From: Chukun Pan Date: Mon, 6 Jan 2025 10:00:01 +0000 (+0800) Subject: phy: rockchip: naneng-combphy: compatible reset with old DT X-Git-Tag: archive/raspbian/6.1.129-1+rpi1^2~87 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f6965ff321b46eb2ebfa9bb3dbe094ed952b9930;p=linux.git phy: rockchip: naneng-combphy: compatible reset with old DT Origin: https://web.git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3126ea9be66b53e607f87f067641ba724be24181 Origin: https://git.kernel.org/linus/3126ea9be66b53e607f87f067641ba724be24181 Bug-Debian: https://bugs.debian.org/1095745 The device tree of RK3568 did not specify reset-names before. So add fallback to old behaviour to be compatible with old DT. Fixes: fbcbffbac994 ("phy: rockchip: naneng-combphy: fix phy reset") Cc: Jianfeng Liu Signed-off-by: Chukun Pan Reviewed-by: Jonas Karlman Link: https://lore.kernel.org/r/20250106100001.1344418-2-amadeus@jmu.edu.cn Signed-off-by: Vinod Koul Gbp-Pq: Topic bugfix/arm64 Gbp-Pq: Name phy-rockchip-naneng-combphy-compatible-reset-with-ol.patch --- diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c index d97a7164c49..2c73cc8dd1e 100644 --- a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c +++ b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c @@ -299,7 +299,10 @@ static int rockchip_combphy_parse_dt(struct device *dev, struct rockchip_combphy priv->ext_refclk = device_property_present(dev, "rockchip,ext-refclk"); - priv->phy_rst = devm_reset_control_get(dev, "phy"); + priv->phy_rst = devm_reset_control_get_exclusive(dev, "phy"); + /* fallback to old behaviour */ + if (PTR_ERR(priv->phy_rst) == -ENOENT) + priv->phy_rst = devm_reset_control_array_get_exclusive(dev); if (IS_ERR(priv->phy_rst)) return dev_err_probe(dev, PTR_ERR(priv->phy_rst), "failed to get phy reset\n");